using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class FT_PKT_IPMap : EntityTypeConfiguration<FT_PKT_IP>
    {
        public FT_PKT_IPMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, t.TYPE, t.NUMBER, t.POSTED });

            // Properties
            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.TYPE)
                .IsRequired()
                .HasMaxLength(1);

            this.Property(t => t.NUMBER)
                .IsRequired()
                .HasMaxLength(7);

            this.Property(t => t.PONUMBER)
                .HasMaxLength(8);

            this.Property(t => t.REFERENCE)
                .HasMaxLength(50);

            this.Property(t => t.USER_INVNO)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.APBATCH)
                .HasMaxLength(8);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            this.Property(t => t.InvoiceShipment)
                .HasMaxLength(8);

            this.Property(t => t.CashVATAcct)
                .HasMaxLength(40);

            this.Property(t => t.VatBatch)
                .HasMaxLength(8);

            this.Property(t => t.vglbatch)
                .HasMaxLength(10);

            this.Property(t => t.Description)
                .HasMaxLength(60);

            this.Property(t => t.ManualVatacct)
                .HasMaxLength(40);

            this.Property(t => t.IP_Approval)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.IP_SupplierReference)
                .HasMaxLength(50);

            this.Property(t => t.IP_Location)
                .HasMaxLength(3);

            this.Property(t => t.IP_CustReference)
                .HasMaxLength(50);

            this.Property(t => t.IP_Cust)
                .HasMaxLength(6);

            this.Property(t => t.C_Catalogue)
                .HasMaxLength(30);

            this.Property(t => t.C_Name)
                .HasMaxLength(200);

            this.Property(t => t.C_Serial)
                .HasMaxLength(10);

            this.Property(t => t.IP_Vendor_Contact)
                .HasMaxLength(100);

            this.Property(t => t.IP_Customer_Contact)
                .HasMaxLength(100);

            this.Property(t => t.C_Vendor)
                .HasMaxLength(6);

            this.Property(t => t.IP_Cust_PO_Number)
                .HasMaxLength(20);

            this.Property(t => t.IP_Cust_PO_Value)
                .HasMaxLength(20);

            this.Property(t => t.IP_FileLocation)
                .HasMaxLength(50);

            this.Property(t => t.IP_Invoice_Number)
                .HasMaxLength(20);

            this.Property(t => t.IP_Invoice_Value)
                .HasMaxLength(20);

            this.Property(t => t.IP_Supplier_Order_confirmation_Number)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("FT_PKT_IP");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.TYPE).HasColumnName("TYPE");
            this.Property(t => t.NUMBER).HasColumnName("NUMBER");
            this.Property(t => t.PONUMBER).HasColumnName("PONUMBER");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.PURCHTYPE).HasColumnName("PURCHTYPE");
            this.Property(t => t.DOCTYPE).HasColumnName("DOCTYPE");
            this.Property(t => t.REFERENCE).HasColumnName("REFERENCE");
            this.Property(t => t.CURRENCY).HasColumnName("CURRENCY");
            this.Property(t => t.COST).HasColumnName("COST");
            this.Property(t => t.POSTED).HasColumnName("POSTED");
            this.Property(t => t.COMMENTS).HasColumnName("COMMENTS");
            this.Property(t => t.CLOSED).HasColumnName("CLOSED");
            this.Property(t => t.CLOSEPO).HasColumnName("CLOSEPO");
            this.Property(t => t.PRINTED).HasColumnName("PRINTED");
            this.Property(t => t.USER_INVNO).HasColumnName("USER_INVNO");
            this.Property(t => t.APBATCH).HasColumnName("APBATCH");
            this.Property(t => t.OVERHEAD).HasColumnName("OVERHEAD");
            this.Property(t => t.Shipment).HasColumnName("Shipment");
            this.Property(t => t.SEASON).HasColumnName("SEASON");
            this.Property(t => t.RETPROFITMARGIN).HasColumnName("RETPROFITMARGIN");
            this.Property(t => t.BU).HasColumnName("BU");
            this.Property(t => t.SALECURRENCY).HasColumnName("SALECURRENCY");
            this.Property(t => t.CLASS).HasColumnName("CLASS");
            this.Property(t => t.COUNTRY).HasColumnName("COUNTRY");
            this.Property(t => t.DISCOUNT).HasColumnName("DISCOUNT");
            this.Property(t => t.COSTBEFOREDISC).HasColumnName("COSTBEFOREDISC");
            this.Property(t => t.DISCOUNTPERCENT).HasColumnName("DISCOUNTPERCENT");
            this.Property(t => t.RetSaleMargin).HasColumnName("RetSaleMargin");
            this.Property(t => t.wholeSaleMArgin).HasColumnName("wholeSaleMArgin");
            this.Property(t => t.DOCDATE).HasColumnName("DOCDATE");
            this.Property(t => t.APOVERHEAD).HasColumnName("APOVERHEAD");
            this.Property(t => t.psid).HasColumnName("psid");
            this.Property(t => t.adjid).HasColumnName("adjid");
            this.Property(t => t.ALLOVERHEADAPPLIED).HasColumnName("ALLOVERHEADAPPLIED");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
            this.Property(t => t.InvoiceShipment).HasColumnName("InvoiceShipment");
            this.Property(t => t.LandedCost).HasColumnName("LandedCost");
            this.Property(t => t.TAX).HasColumnName("TAX");
            this.Property(t => t.Imported).HasColumnName("Imported");
            this.Property(t => t.TAXLL).HasColumnName("TAXLL");
            this.Property(t => t.TotalLAndedCostVendCurr).HasColumnName("TotalLAndedCostVendCurr");
            this.Property(t => t.CashVATAcct).HasColumnName("CashVATAcct");
            this.Property(t => t.VatBatch).HasColumnName("VatBatch");
            this.Property(t => t.EFFECTIVEDATE).HasColumnName("EFFECTIVEDATE");
            this.Property(t => t.CSTCTRID).HasColumnName("CSTCTRID");
            this.Property(t => t.vglbatch).HasColumnName("vglbatch");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.ManualVatacct).HasColumnName("ManualVatacct");
            this.Property(t => t.ParityB1).HasColumnName("ParityB1");
            this.Property(t => t.ParityB2).HasColumnName("ParityB2");
            this.Property(t => t.IP_Approval).HasColumnName("IP_Approval");
            this.Property(t => t.IP_CreatedBy).HasColumnName("IP_CreatedBy");
            this.Property(t => t.IP_UID).HasColumnName("IP_UID");
            this.Property(t => t.IP_SupplierReference).HasColumnName("IP_SupplierReference");
            this.Property(t => t.IP_Location).HasColumnName("IP_Location");
            this.Property(t => t.IP_ApplyVAT).HasColumnName("IP_ApplyVAT");
            this.Property(t => t.IP_ApplyRoutineOverhead).HasColumnName("IP_ApplyRoutineOverhead");
            this.Property(t => t.IP_CustReference).HasColumnName("IP_CustReference");
            this.Property(t => t.IP_DeliveryDate).HasColumnName("IP_DeliveryDate");
            this.Property(t => t.IP_TenderClosingDate).HasColumnName("IP_TenderClosingDate");
            this.Property(t => t.IP_TenderBond).HasColumnName("IP_TenderBond");
            this.Property(t => t.IP_Cust).HasColumnName("IP_Cust");
            this.Property(t => t.IP_Salesman).HasColumnName("IP_Salesman");
            this.Property(t => t.IP_Followup).HasColumnName("IP_Followup");
            this.Property(t => t.IP_Opportunity).HasColumnName("IP_Opportunity");
            this.Property(t => t.IP_Project).HasColumnName("IP_Project");
            this.Property(t => t.IP_Site).HasColumnName("IP_Site");
            this.Property(t => t.IP_CreatedON).HasColumnName("IP_CreatedON");
            this.Property(t => t.SPID).HasColumnName("SPID");
            this.Property(t => t.IP_UID2).HasColumnName("IP_UID2");
            this.Property(t => t.IP_Profit).HasColumnName("IP_Profit");
            this.Property(t => t.IP_TotalSelling).HasColumnName("IP_TotalSelling");
            this.Property(t => t.RetailPrice).HasColumnName("RetailPrice");
            this.Property(t => t.C_Catalogue).HasColumnName("_Catalogue");
            this.Property(t => t.C_Name).HasColumnName("_Name");
            this.Property(t => t.C_Note).HasColumnName("_Note");
            this.Property(t => t.C_Type).HasColumnName("_Type");
            this.Property(t => t.C_Category).HasColumnName("_Category");
            this.Property(t => t.C_UOO).HasColumnName("_UOO");
            this.Property(t => t.C_UOS).HasColumnName("_UOS");
            this.Property(t => t.C_Serial).HasColumnName("_Serial");
            this.Property(t => t.C_Factor).HasColumnName("_Factor");
            this.Property(t => t.IP_Vendor_Contact).HasColumnName("IP_Vendor_Contact");
            this.Property(t => t.IP_Customer_Contact).HasColumnName("IP_Customer_Contact");
            this.Property(t => t.C_Vendor).HasColumnName("_Vendor");
            this.Property(t => t.IP_Cust_PO_Number).HasColumnName("IP_Cust_PO_Number");
            this.Property(t => t.IP_Cust_PO_Date).HasColumnName("IP_Cust_PO_Date");
            this.Property(t => t.IP_Cust_PO_Value).HasColumnName("IP_Cust_PO_Value");
            this.Property(t => t.IP_FileLocation).HasColumnName("IP_FileLocation");
            this.Property(t => t.IP_Invoice_Number).HasColumnName("IP_Invoice_Number");
            this.Property(t => t.IP_Invoice_Date).HasColumnName("IP_Invoice_Date");
            this.Property(t => t.IP_Invoice_Value).HasColumnName("IP_Invoice_Value");
            this.Property(t => t.IP_Supplier_Order_confirmation_Number).HasColumnName("IP_Supplier_Order_confirmation_Number");
            this.Property(t => t.IP_TenderBondAmount).HasColumnName("IP_TenderBondAmount");
        }
    }
}
